package xyz.hzxiao.exposed;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import xyz.hzxiao.entity.order.DemoOrderEntity;
import xyz.hzxiao.facade.OrderFacade;
import xyz.hzxiao.order.service.DemoOrderService;
import xyz.hzxiao.result.JsonResult;

import java.util.List;

/**
 * 订单暴露控制器
 *
 * @author ：FuXx
 * @className : xyz.hzxiao.exposed.OrderExposedController
 * @since ：2023/12/5
 */
@RestController
@RequiredArgsConstructor
public class OrderExposedController implements OrderFacade {

    private final DemoOrderService currentService;

    @Override
    public JsonResult<List<DemoOrderEntity>> orderList(Integer userId) {
        try {
            return currentService.orderList(userId);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
